'use strict';

/**
 * @name: nike test
 * @description: nike test
 * @version: 0.0.1
 * @author: xiech
 * @date: 2023年03月13日17:56:33
 */

const ctxutil = require('@ym_interaction/ctx_util');
const moment = require('moment-timezone');
moment.tz.setDefault('Asia/Shanghai');

exports.main = async (ctx) => {
  await ctxutil.apply(ctx);
  const mixNick = ctx.mixNick;
  const currentTime = moment().format('YYYY-MM-DD HH:mm:ss');
  const result = {};
  try {

    const res = await ctx.cloud.topApi.invoke({
      api: 'taobao.crm.member.identity.get',
      data: {
        // extra_info:'{\"source\":\"paiyangji\",\"deviceId\":\"testId\",\"itemId\":565058963761}',
        // mix_nick: mixNick,
        open_id:'AAEzpHEBANp_BawPu9kIe0H0',
      },
      autoSession: true,
    });

    result.res = res;

    return await ctx.mfutil.common.basicode(0, result);
  } catch (e) {
    return await ctx.mfutil.common.basicode(e.code || 8000, e);
  }
}